bitkeeper revision 1.1342 (4266673eMuou_Ng4Ze7pzPUJ4IL7bg)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 20 Apr 2005 14:29:18 +0000 (14:29 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 20 Apr 2005 14:29:18 +0000 (14:29 +0000)
Fix memset/memcmp/memmove declaration/definition.
Signed-off-by: Keir Fraser <keir@xensource.com>
.rootkeys
xen/arch/x86/string.c [new file with mode: 0644]
xen/include/asm-x86/x86_32/string.h
xen/include/asm-x86/x86_64/string.h

index 537470ff4b1788708770f9857c519d31befd43cc..66b981152c5cdb3682b9d3058f862440eb40a1cd 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 405b8599xI_PoEr3zZoJ2on-jdn7iw xen/arch/x86/shadow.c
 3ddb79bcSx2e8JSR3pdSGa8x1ScYzA xen/arch/x86/smp.c
 3ddb79bcfUN3-UBCPzX26IU8bq-3aw xen/arch/x86/smpboot.c
+4266673dBje6CS6CwQ3lEdvWbf5Dcw xen/arch/x86/string.c
 3ddb79bc-Udq7ol-NX4q9XsYnN7A2Q xen/arch/x86/time.c
 3ddb79bccYVzXZJyVaxuv5T42Z1Fsw xen/arch/x86/trampoline.S
 3ddb79bcOftONV9h4QCxXOfiT0h91w xen/arch/x86/traps.c
diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
new file mode 100644 (file)
index 0000000..5a7788b
--- /dev/null
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * string.c
+ * 
+ * These provide something for compiler-emitted string operations to link
+ * against.
+ */
+
+#include <xen/config.h>
+#include <xen/lib.h>
+
+#undef memmove
+void *memmove(void *dest, const void *src, size_t count)
+{
+    return __memmove(dest, src, count);
+}
+
+#undef memcpy
+void *memcpy(void *dest, const void *src, size_t count)
+{
+    return __memcpy(dest, src, count);
+}
+
+#undef memset
+void *memset(void *s, int c, size_t count)
+{
+    return __memset(s, c, count);
+}
index 43fad09eeaa8213da512db8178f93ea2c756d230..b25ec8df610b1a07621fefac1fa9c5e9d72dcaf4 100644 (file)
@@ -184,7 +184,7 @@ __asm__ __volatile__(
 return __res;
 }
 
-static inline void * __memcpy(void * to, const void * from, size_t n)
+static inline void * __variable_memcpy(void * to, const void * from, size_t n)
 {
 int d0, d1, d2;
 __asm__ __volatile__(
@@ -272,12 +272,13 @@ __asm__ __volatile__( \
 }
 
 #define __HAVE_ARCH_MEMCPY
-static always_inline __attribute_used__
-void memcpy(void *t, const void *f, size_t n)
+#define memcpy(t,f,n) (__memcpy((t),(f),(n)))
+static always_inline
+void *__memcpy(void *t, const void *f, size_t n)
 {
-       (__builtin_constant_p(n) ?
+       return (__builtin_constant_p(n) ?
         __constant_memcpy((t),(f),(n)) :
-        __memcpy((t),(f),(n)));
+        __variable_memcpy((t),(f),(n)));
 }
 
 /*
@@ -299,7 +300,8 @@ void memcpy(void *t, const void *f, size_t n)
 */
 
 #define __HAVE_ARCH_MEMMOVE
-static inline void * memmove(void * dest,const void * src, size_t n)
+#define memmove(dest,src,n) (__memmove((dest),(src),(n)))
+static inline void *__memmove(void * dest,const void * src, size_t n)
 {
 int d0, d1, d2;
 if (dest<src)
@@ -455,16 +457,17 @@ __asm__  __volatile__( \
  __constant_c_and_count_memset((s),(c),(count)) : \
  __constant_c_memset((s),(c),(count)))
 
-#define __memset(s, c, count) \
+#define __var_x_memset(s, c, count) \
 (__builtin_constant_p(count) ? \
  __constant_count_memset((s),(c),(count)) : \
  __memset_generic((s),(c),(count)))
 
 #define __HAVE_ARCH_MEMSET
-#define memset(s, c, count) \
+#define memset(s, c, count) (__memset((s),(c),(count)))
+#define __memset(s, c, count) \
 (__builtin_constant_p(c) ? \
  __constant_c_x_memset((s),(0x01010101UL*(unsigned char)(c)),(count)) : \
- __memset((s),(c),(count)))
+ __var_x_memset((s),(c),(count)))
 
 /*
  * find the first occurrence of byte 'c', or 1 past the area if none
index 85775ffb96bf06b2b8bb5597f15bca222d9525e2..6c1cc902f9e373045d662abddf9efed77f58e901 100644 (file)
@@ -1,6 +1,16 @@
 #ifndef _X86_64_STRING_H_
 #define _X86_64_STRING_H_
 
-/* nothing */
+#define __HAVE_ARCH_MEMMOVE
+#define memmove(dest,src,n) (__memmove((dest),(src),(n)))
+#define __memmove(dest,src,n) (__builtin_memmove((dest),(src),(n)))
+
+#define __HAVE_ARCH_MEMCPY
+#define memcpy(t,f,n) (__memcpy((t),(f),(n)))
+#define __memcpy(t,f,n) (__builtin_memcpy((t),(f),(n)))
+
+#define __HAVE_ARCH_MEMSET
+#define memset(s, c, count) (__memset((s),(c),(count)))
+#define __memset(s, c, count) (__builtin_memset((s),(c),(count)))
 
 #endif